package com.vertx.func;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;

public class FunctionTest {
	public static void main(String[] args) {

		//IntPredicate 自带类型的函数接口，可优先使用
		Predicate<Integer> predicate = i -> i > 0;
		System.out.println(predicate.test(-9));

		//IntConsumer
		Consumer<String> consumer = s -> System.out.println(s);
		consumer.accept("qqqq");

		Function<Integer, Integer> function = x -> x * 2;
		System.out.println(function.apply(10));

	}
}
